from models import db


class Old(db.Model):
    """老人"""
    __tablename__ = 'oldperson_info'
    __table_args__ = {'mysql_engine': 'InnoDB'}  # 支持事务操作和外键
    ID = db.Column(db.Integer, doc='ID', primary_key=True, nullable=False, autoincrement=True)
    name = db.Column(db.String(20), doc='username', nullable=False)
    gender = db.Column(db.String(10), doc='gender')
    # birthday = db.Column(db.DateTime)
    checkin_date = db.Column(db.DateTime)
    checkout_date = db.Column(db.DateTime)
    room_number = db.Column(db.String(50), doc='room_number')
    age = db.Column(db.Integer, doc='age')
    phone = db.Column(db.String(50), doc='phone')
    remove = db.Column(db.Integer, doc='REMOVE', default=1)
    description = db.Column(db.String(50), doc='DESCRIPTION', default='这个人很懒，什么也没留下')
    health_state = db.Column(db.String(50), doc='health_state', default='良好')
    profile_photo = db.Column(db.String(200))
